import cloneDeep from 'lodash/cloneDeep';

const allRows = [
    {
        id: '01',
        housePlace: 1,
        socialType: 1,
        minPayAmt: 1800,
        companyRate: 12,
        companyAmt: 216,
        personRate: 8,
        personAmt: 14.6,
        totalAmt: 360,
        limitDownAmt: 16168,
        limitUpperAmt: 1800
    },
    {
        id: '02',
        housePlace: 1,
        socialType: 2,
        minPayAmt: 2800,
        companyRate: 22,
        companyAmt: 216,
        personRate: 28,
        personAmt: 146,
        totalAmt: 760,
        limitDownAmt: 26168,
        limitUpperAmt: 2800
    },
    {
        id: '03',
        housePlace: 1,
        socialType: 3,
        minPayAmt: 1800,
        companyRate: 12,
        companyAmt: 216,
        personRate: 8,
        personAmt: 146,
        totalAmt: 360,
        limitDownAmt: 16168,
        limitUpperAmt: 1800
    },
    {
        id: '04',
        housePlace: 1,
        socialType: 4,
        minPayAmt: 1800,
        companyRate: 12,
        companyAmt: 216,
        personRate: 8,
        personAmt: 146,
        totalAmt: 360,
        limitDownAmt: 16168,
        limitUpperAmt: 1800
    },
    {
        id: '05',
        housePlace: 1,
        socialType: 5,
        minPayAmt: 1800,
        companyRate: 12,
        companyAmt: 216,
        personRate: 8,
        personAmt: 146,
        totalAmt: 360,
        limitDownAmt: 16168,
        limitUpperAmt: 1800
    },
    {
        id: '06',
        housePlace: 1,
        socialType: 6,
        minPayAmt: 1800,
        companyRate: 12,
        companyAmt: 216,
        personRate: 8,
        personAmt: 146,
        totalAmt: 360,
        limitDownAmt: 16168,
        limitUpperAmt: 1800
    },

    {
        id: '07',
        housePlace: 2,
        socialType: 1,
        minPayAmt: 1800,
        companyRate: 12,
        companyAmt: 216,
        personRate: 8,
        personAmt: 146,
        totalAmt: 360,
        limitDownAmt: 16168,
        limitUpperAmt: 1800
    },
    {
        id: '08',
        housePlace: 2,
        socialType: 2,
        minPayAmt: 1800,
        companyRate: 12,
        companyAmt: 216,
        personRate: 8,
        personAmt: 146,
        totalAmt: 360,
        limitDownAmt: 16168,
        limitUpperAmt: 1800
    },
    {
        id: '09',
        housePlace: 2,
        socialType: 3,
        minPayAmt: 1800,
        companyRate: 12,
        companyAmt: 216,
        personRate: 8,
        personAmt: 146,
        totalAmt: 360,
        limitDownAmt: 16168,
        limitUpperAmt: 1800
    },
    {
        id: '10',
        housePlace: 2,
        socialType: 4,
        minPayAmt: 1800,
        companyRate: 12,
        companyAmt: 216,
        personRate: 8,
        personAmt: 146,
        totalAmt: 360,
        limitDownAmt: 16168,
        limitUpperAmt: 1800
    },
    {
        id: '11',
        housePlace: 2,
        socialType: 5,
        minPayAmt: 1800,
        companyRate: 12,
        companyAmt: 216,
        personRate: 8,
        personAmt: 146,
        totalAmt: 360,
        limitDownAmt: 16168,
        limitUpperAmt: 1800
    },
    {
        id: '12',
        housePlace: 2,
        socialType: 6,
        minPayAmt: 1800,
        companyRate: 12,
        companyAmt: 216,
        personRate: 8,
        personAmt: 146,
        totalAmt: 360,
        limitDownAmt: 168,
        limitUpperAmt: 1800
    }
];
const dataBefore = cloneDeep(allRows);

const dataAfter = cloneDeep(allRows);
dataAfter[0].status = 1;
dataAfter[1].status = 2;
dataAfter[2].status = 3;
dataAfter[2].isMinPayAmt = 1;


const search = () => {
    console.log(allRows);
    return {
        code: 10000,
        data: {
            employeeDepartment: 'work组',
            employeeName: '张三',
            expireTime: '2020-12-30',
            dataBefore,
            dataAfter
        }
    };
};

export default {
    'GET x/api/finance/salary/v1/setting/social/next/step/*': (req, res) => {
        res.json(search(req));
    }
};
